Skip to content

Conversation

PradnyaC11
Copy link

@PradnyaC11 PradnyaC11 commented Jun 13, 2024

Guidelines for Pull Requests

If you haven't yet read our code review guidelines, please do so, You can find them here.

Please confirm the following by adding an x for each item (turn [ ] into [x]).

  • I have removed all code style changes that are not necessary (e.g. changing blanks across the whole file that don’t need to be changed, adding empty lines in parts other than your own code)
  • I am not making any changes to files that don’t have any effect (e.g. imports added that don’t need to be added)
  • I do not have any sysout statements in my code or commented out code that isn’t needed anymore
  • I am not reformatting any files in the wrong format or without cause.
  • I am not changing file encoding or line endings to something else than UTF-8, LF
  • My pull request does not show an insane amount of files being changed although my ticket only requires a few files being changed
  • I have added Javadoc/documentation where appropriate
  • I have added test cases where appropriate
  • I have explained any part of my code/implementation decisions that is not be self-explanatory

Please provide a brief description of your ticket

The user should be able to search in crossref to references to import. whatever search results from Crossref a user selects should then be imported into citesphere. This could be all search results or just a few or one.

For now, let's put add an entry to the import menu and let the user select which group to import the results into from a dropdown menu.

The importing should be done from Citesphere Importer (not Citesphere), similar how entries from files are imported.

For querying crossref, this library should be used: https://github.com/diging/crossref-connect. However, this is not yet released into maven central, so talk to Julia before picking up this ticket.

... Put ticket description here and add link to ticket ...
https://diging.atlassian.net/browse/CITE-177

Are there any other pull requests that this one depends on?

diging/citesphere-messages#12
diging/citesphere#271

Anything else the reviewer needs to know?

... describe here ...

@diging-jenkins
Copy link

Can one of the admins verify this patch?

@PradnyaC11 PradnyaC11 changed the title Story/cite 177 Story/cite-177 There needs to be an import from Crossref Jun 13, 2024
@PradnyaC11 PradnyaC11 reopened this Sep 5, 2024
Copy link
Member

@jdamerow jdamerow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unaddressed comments

@jdamerow jdamerow closed this Sep 6, 2024
@PradnyaC11 PradnyaC11 reopened this Sep 20, 2024
@jdamerow
Copy link
Member

Looks fine. Once the Citesphere PR is ready to be tested, I'll deploy this.

private ArticleMeta parseArticleMeta(Item item) {
ArticleMeta meta = new ArticleMeta();
meta.setArticleTitle(item.getTitle().get(0));
meta.setShortTitle(String.join(", ", item.getTitle().subList(1, item.getTitle().size())));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't seem right. Why would the short title be a concatenation of all other titles? If zotero doesn't allow additional titles, then we might just want to drop them for now.

contributors.addAll(mapPersonToContributor(item.getTranslator(), ContributionType.TRANSLATOR));
}
// List of chair
if(item.getChair() != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that all contributor types that crossref knows?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. crossref has 4 types of contributors - authors, editors, translators & chair

}
meta.setContributors(contributors);

meta.setAuthorNotesCorrespondence(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't that the default?

meta.setLanguage(item.getLanguage());
ReviewInfo review = new ReviewInfo();
if (item.getReview() != null) {
review.setFullDescription(item.getReview().getCompetingInterestStatement());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is full description the same as competing interest statement?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

private Reference mapSingleReference(edu.asu.diging.crossref.model.Reference itemRef) {
Reference ref = new Reference();
ref.setAuthorString(itemRef.getAuthor());
ref.setContributors(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as before, isn't that the default value?

@jdamerow jdamerow closed this Nov 26, 2024
@PradnyaC11 PradnyaC11 reopened this Dec 9, 2024
@PradnyaC11 PradnyaC11 requested a review from jdamerow December 9, 2024 23:32
itemTypeMapping.put(Publication.NEWS_ITEM, ItemType.NEWSPAPER_ARTICLE);
itemTypeMapping.put(Publication.PROCEEDINGS_PAPER, ItemType.CONFERENCE_PAPER);
itemTypeMapping.put(Publication.DOCUMENT, ItemType.DOCUMENT);
itemTypeMapping.put(Publication.BOOK, ItemType.BOOK);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate of line 63

itemTypeMapping.put(Publication.EDITED_BOOK, ItemType.BOOK);
itemTypeMapping.put(Publication.PROCEEDINGS_PAPER, ItemType.CONFERENCE_PAPER);
itemTypeMapping.put(Publication.DISSERTATION, ItemType.THESIS);
itemTypeMapping.put(Publication.BOOK_CHAPTER, ItemType.BOOK_SECTION);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate

@@ -0,0 +1,157 @@
package edu.asu.diging.citesphere.importer.core.service.parse.crossref;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be moved to an impl package

import edu.asu.diging.crossref.model.Person;

@Component
public class CrossRefParser implements ICrossRefParser {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs javadoc and tests

@jdamerow jdamerow closed this Jan 9, 2025
@PradnyaC11 PradnyaC11 reopened this Jan 14, 2025
@PradnyaC11 PradnyaC11 requested a review from jdamerow January 14, 2025 23:25
}

@Test
public void testParseJournalMeta_WithValidData() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test method names should follow our naming convention (documented in confluence)

@jdamerow jdamerow closed this Jan 21, 2025
@PradnyaC11 PradnyaC11 reopened this Mar 27, 2025
@Override
public ContainerMeta parseJournalMeta(Item item) {
ContainerMeta meta = new ContainerMeta();
meta.setContainerTitle(item.getContainerTitle().get(0));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there more than one title?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, crossref API is returning list of strings for title

@Override
public ArticleMeta parseArticleMeta(Item item) {
ArticleMeta meta = new ArticleMeta();
meta.setArticleTitle(item.getTitle().get(0));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, are there more than one?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, crossref API is returning list of strings for title

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should be a comment here

if(dateParts != null) {
publicationDate.setPublicationDate(dateParts.get(2).toString());
publicationDate.setPublicationMonth(dateParts.get(1).toString());
publicationDate.setPublicationYear(dateParts.get(0).toString());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are all of these always set or could date be null for example?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

publicationDate will be null, only if the published date is missing. That was case for some citations. Hance, the check for dateParts is added.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, can dateParts.get(2) return null? If so, toString() would throw an exception I believe?

@jdamerow
Copy link
Member

jdamerow commented May 5, 2025

Make it so, Jenkins.

2 similar comments
@jdamerow
Copy link
Member

jdamerow commented May 5, 2025

Make it so, Jenkins.

@jdamerow
Copy link
Member

jdamerow commented May 5, 2025

Make it so, Jenkins.

@jdamerow
Copy link
Member

jdamerow commented May 5, 2025

I get compilation errors on Jenkins. I think there are some dependencies missing that are needed for the upgrade. Also, can you please update the Java version in the pom to 11?

@jdamerow jdamerow closed this May 5, 2025
@PradnyaC11 PradnyaC11 reopened this May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants